<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>

<html>
<head>
    <%@include file="/WEB-INF/views/layout/base.ref.jsp" %>
    <%@include file="/WEB-INF/views/layout/valid.ref.jsp" %>
</head>
<body>
<form method="post" id="form1" action="${ctx}/sysPubCode/save">
    <input type="hidden" name="id" value="${sysPubCode.id}"/>
    <%@include file="/WEB-INF/views/login/home/toolbar.jsp" %>
    <div class="mtcontent">
        <div class="mtheader">
            <shiro:hasPermission name="sysPubCode:edit">
                <a class="mtbtn one" href="#" onclick="hrefSave_OnClick('form1')"><i
                        class="mtfa mt-dui"></i><span>保存</span></a>
            </shiro:hasPermission>
            <a class="mtbtn two" href="#" onclick="hrefRet_OnClick('${ctx}/sysPubCode/list')"><i
                    class="mtfa mt-refresh"></i><span>返回</span></a>
        </div>
        <div class="mtbody">
            <div class="mtrow">
                <div class="mtcol">
                    <label class="mtlabel">用途：</label>
                    <select class="mtinput" name="pubCodeTypeId">
                        <c:forEach var="pubcode" items="${pubCodeTypes}">
                            <option value="${pubcode.id}" ${pubcode.id eq sysPubCode.pubCodeTypeId ? "selected = 'selected'":"" }>${pubcode.name}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol">
                    <label class="mtlabel">单据编号 </label> <input type="text"
                                                                class="mtinput" name="currentVoucher"
                                                                value="${sysPubCode.currentVoucher}"/>
                </div>
                <div class="mtcol">
                    <label class="mtlabel" for="beginNum">当前序号 </label> <span
                        class="block mtinput mticon-input mticon-input-right"> <input
                        type="text" id="beginNum" name="beginNum" class="required"
                        value="${sysPubCode.beginNum}"/><i
                        class="mtfa mt-star mtred"></i>
						</span>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol">
                    <label class="mtlabel" for="voucherName">单据名称 </label> <span
                        class="block mtinput mticon-input mticon-input-right"> <input
                        type="text" id="voucherName" name="voucherName" class="required"
                        value="${sysPubCode.voucherName}"/><i
                        class="mtfa mt-star mtred"></i>
						</span>
                </div>
                <div class="mtcol">
                    <label class="mtlabel" for="keyword">关键字 </label> <span
                        class="block mtinput mticon-input mticon-input-right"> <input
                        type="text" id="keyword" name="keyword" class="required"
                        value="${sysPubCode.keyword}"/><i
                        class="mtfa mt-star mtred"></i>
						</span>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol">
                    <label class="mtlabel">编号前缀 </label> <input type="text"
                                                                class="mtinput" name="numberPrefix"
                                                                value="${sysPubCode.numberPrefix}"/>
                </div>
                <div class="mtcol">
                    <label class="mtlabel">日期模式 </label>
                    <div>
                        <select name="datePattern" class="mtinput" style="height:28px;">
                            <option ${sysPubCode.datePattern eq "" ? 'selected="selected"' : ''} value="">无日期</option>
                            <option ${sysPubCode.datePattern eq "yyyyMMdd" ? 'selected="selected"' : ''}
                                    value="yyyyMMdd">yyyyMMdd
                            </option>
                            <option ${sysPubCode.datePattern eq "yyyy-MM-dd" ? 'selected="selected"' : ''}
                                    value="yyyy-MM-dd">yyyy-MM-dd
                            </option>
                            <option ${sysPubCode.datePattern eq "yyyyMM" ? 'selected="selected"' : ''} value="yyyyMM">
                                yyyyMM
                            </option>
                            <option ${sysPubCode.datePattern eq "yyyy" ? 'selected="selected"' : ''} value="yyyy">yyyy
                            </option>
                            <option ${sysPubCode.datePattern eq "yy" ? 'selected="selected"' : ''} value="yy">yy
                            </option>

                        </select>
                    </div>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol">
                    <label class="mtlabel">分割符号 </label> <input type="text"
                                                                class="mtinput" name="splitSign"
                                                                value="${sysPubCode.splitSign}"/>
                </div>
                <div class="mtcol">
                    <label class="mtlabel">序号模式 </label>
                    <div>
                        <select name="numberPattern" class="mtinput" style="height:28px;">
                            <option ${sysPubCode.numberPattern eq "" ? 'selected="selected"' : ''} value="">无日期</option>
                            <option ${sysPubCode.numberPattern eq "yyyyMMdd" ? 'selected="selected"' : ''}
                                    value="yyyyMMdd">yyyyMMdd
                            </option>
                            <option ${sysPubCode.numberPattern eq "yyyy-MM-dd" ? 'selected="selected"' : ''}
                                    value="yyyy-MM-dd">yyyy-MM-dd
                            </option>
                            <option ${sysPubCode.numberPattern eq "yyyyMM" ? 'selected="selected"' : ''} value="yyyyMM">
                                yyyyMM
                            </option>
                            <option ${sysPubCode.numberPattern eq "yyyy" ? 'selected="selected"' : ''} value="yyyy">yyyy
                            </option>
                            <option ${sysPubCode.numberPattern eq "yy" ? 'selected="selected"' : ''} value="yy">yy
                            </option>

                        </select>
                    </div>
                </div>
            </div>
            <div class="mtrow">

                <div class="mtcol">
                    <label class="mtlabel">计数方式 </label>
                    <div>
                        <select class="mtinput" name="newNumber" style="height:28px;">
                            <option ${sysPubCode.newNumber eq "1" ? 'selected="selected"' : ''} value="1">每日重复计数
                            </option>
                            <option ${sysPubCode.newNumber eq "2" ? 'selected="selected"' : ''} value="2">每月重复计数
                            </option>
                            <option ${sysPubCode.newNumber eq "3" ? 'selected="selected"' : ''} value="3">每年重复计数
                            </option>
                            <option ${sysPubCode.newNumber eq "4" ? 'selected="selected"' : ''} value="4">不重复计数</option>
                        </select>
                    </div>
                </div>
                <div class="mtcol">
                    <label class="mtlabel">编号后缀 </label> <input type="text"
                                                                class="mtinput" name="numberAfter"
                                                                value="${sysPubCode.numberAfter}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">备注 </label>
                    <textarea name="remark" class="mtinput2" style="height: 80px;">${sysPubCode.remark}</textarea>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>

<script type="text/javascript">

    $(function () {
        $("#form1").validate({
            submitHandler: function (form) {
                hrefSave_OnClick("form1");
            },
            onfocusout: function (element) {
                $(element).valid();
            }
        });
    });
</script>
